package com.jeecg.p3.dzdp.dao.impl;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.utils.common.PageQueryWrapper;
import org.jeecgframework.p3.core.utils.persistence.mybatis.GenericDaoDefault;
import org.springframework.stereotype.Repository;

import com.google.common.collect.Maps;
import com.jeecg.p3.dzdp.dao.WxActDzdpPropertyDao;
import com.jeecg.p3.dzdp.entity.WxActDzdpProperty;

@Repository("wxActDZDPPropertyDaoImpl")
public class WxActDZDPPropertyDaoImpl extends GenericDaoDefault<WxActDzdpProperty> implements WxActDzdpPropertyDao {


	@Override
	public Integer count(PageQuery<WxActDzdpProperty> pageQuery) {
		return (Integer) super.queryOne("count",pageQuery);
	}

	@Override
	public List<WxActDzdpProperty> queryPageList(PageQuery<WxActDzdpProperty> pageQuery, Integer itemCount) {
		PageQueryWrapper<WxActDzdpProperty> wrapper=new PageQueryWrapper<WxActDzdpProperty>(pageQuery.getPageNo(),pageQuery.getPageSize(),itemCount,pageQuery.getQuery());
		return (List<WxActDzdpProperty>)super.query("queryPageList",wrapper);
	}
	

	@Override
	public List<WxActDzdpProperty> queryProperties(String jwid) {
		// TODO Auto-generated method stub
		return (List<WxActDzdpProperty>)super.query("queryActs",jwid);
	}
	@Override
	public List<WxActDzdpProperty> queryPropertyByBaseId(String BaseId){
		return (List<WxActDzdpProperty>)super.query("queryPropertyByBaseId",BaseId);
	}
	@Override
	public List<WxActDzdpProperty> queryPropertyInIds(String ids){
		Map<String,Object> params=Maps.newConcurrentMap();
		String []arr=ids.split(",");
		List<String> list=Arrays.asList(arr);
		params.put("ids", list);
		return (List<WxActDzdpProperty>)super.query("queryPropertyInIds",params);
	}
}
